package com.ssy.lingxi.system.controller;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.system.dto.request.PayWayRequest;
import com.ssy.lingxi.system.entity.PayWay;
import com.ssy.lingxi.system.service.PayWayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
/**
 * @menu 支付方式配置-支付方式设置
 * @author wrc
 * @date 2020/7/20
 */
@Api(tags = "支付方式设置")
@RestController
public class PayWayController {
    @Resource
    private PayWayService payWayService;

    @ApiOperation(value = "查询支付方式配置")
    @GetMapping("/pay/way/list")
    public Wrapper<List<PayWay>> payWayList() {
        return payWayService.payWayList();
    }

    @ApiOperation(value = "修改支付方式配置")
    @PostMapping("/pay/way/update")
    public Wrapper<Void> payWayUpdate(@RequestBody PayWayRequest request) {
        return payWayService.payWayUpdate(request);
    }

}
